﻿<UserControl x:Class="gestadh45.wpf.UserControls.OutilsUC.ReportingUC"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4" 
			 xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
			 xmlns:enum="clr-namespace:gestadh45.business.Enums;assembly=gestadh45.business"
			 mc:Ignorable="d" 
			 d:DesignHeight="400" d:DesignWidth="600">
	<DockPanel Margin="5,5,5,5">
		<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" HorizontalAlignment="Center">
			<TextBlock DockPanel.Dock="Top"
			Text="{Binding Source={x:Static enum:CodesUC.EcranReporting}, Converter={StaticResource ResourceKey=CodeUCToString}}"
			HorizontalAlignment="Stretch" Margin="0,5,0,10" 
			TextAlignment="Center" Style="{StaticResource ResourceKey=titreUC}" />

			<Button ToolTip="Rapport" Margin="10,5,5,5" Style="{StaticResource ResourceKey=bigButton}"
					Command="{Binding Path=ReportCommand}">
				<Image Source="/gestadh45.wpf;component/Images/btn_saveAndJoin.png" />
			</Button>
		</StackPanel>
		
		

		<ComboBox Name="comboChoixReport" ItemsSource="{Binding Path=ListeReports}" DockPanel.Dock="Top">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="SelectionChanged">
					<cmd:EventToCommand 
							Command="{Binding Path=ChangeReportCommand, Mode=OneWay}" 
							CommandParameter="{Binding ElementName=comboChoixReport, Path=SelectedItem}" />
				</i:EventTrigger>
			</i:Interaction.Triggers>

			<ComboBox.ItemTemplate>
				<DataTemplate>
					<TextBlock Text="{Binding Converter={StaticResource ResourceKey=CodeReportToString}}" />
				</DataTemplate>
			</ComboBox.ItemTemplate>
		</ComboBox>

		<Separator Margin="0,10,0,10" />

		<DataGrid Name="dgReport"
				  ItemsSource="{Binding Path=ReportDatas}" 
				  IsReadOnly="True" 
				  AutoGenerateColumns="True" AutoGeneratingColumn="dgReport_AutoGeneratingColumn" />
	</DockPanel>
</UserControl>
